#ifndef system_atomic_h
#define system_atomic_h

#include <common\include\interface.h>

namespace sys
{
	class atomic : public cmn::interface_t, public cmn::noncopyable
	{
	public:
		typedef cmn::int32 T;

		virtual T count()		= 0;

		virtual T increase()	= 0;

		virtual T decrease()	= 0;

		virtual T exchange(T)	= 0;

		virtual bool cmp_exchange(T _compare, T _exchange) = 0;

		virtual T fetch_add(T)	= 0;

		virtual T fetch_sub(T)	= 0;

		virtual T fetch_and(T)	= 0;

		virtual T fetch_or(T)	= 0;

		virtual T fetch_xor(T)	= 0;
	};
	
	atomic* create_atomic();
}
#endif